/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package file;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import javax.swing.JPanel;

/**
 *
 * @author sony
 */
public class ppswd_1 extends JPanel {
     private JLabel labelnama ;
     private JTextField textnama ;
     private JLabel labelpswd ;
     private JTextField textpswd ;
     private JButton tombolSimpan ;
     private JButton tombolBatal ;

     public ppswd_1 (){
         this.setSize(400,300);
         setLayout(null);

         labelnama=new JLabel("Nama: ");
         labelnama.setBounds(50, 50, 150, 40);
         add(labelnama);

          textnama=new JTextField(20);
          textnama.setBounds(150, 60, 150, 20);
          add(textnama);

         labelpswd  =new JLabel("pswd :  ");
         labelpswd .setBounds(50, 80, 150, 40);
         add(labelpswd);

         textpswd=new JTextField(20);
         textpswd.setBounds(150, 90, 150, 20);
         add(textpswd);

         tombolSimpan =new JButton ("Simpan");
         tombolSimpan .setBounds(130, 260, 100, 20);
         add(tombolSimpan );
         tombolSimpan.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                simpanAction();
            }
               public void simpanAction() {
               JOptionPane.showConfirmDialog(null,"Simpan","Tambah",JOptionPane.OK_CANCEL_OPTION);

     }
                                                     });

         tombolBatal =new JButton ("Batal");
         tombolBatal .setBounds(175,150, 100, 20);
         add(tombolBatal );
         tombolBatal.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                exitCommand(e);
            }
            private void exitCommand(ActionEvent e) {
               System.exit(0);
      }
                                                     });
  }
}



